<?php
namespace ImiDemo\HttpDemo\MainServer\Model;

use Imi\Model\Model;
use Imi\Model\Annotation\Table;
use Imi\Model\Annotation\Column;
use Imi\Model\Annotation\Entity;

/**
 * UserRole
 * @Entity
 * @Table(name="tb_user_role", id={"user_id", "role_id"})
 * @property int $userId
 * @property int $roleId
 */
class UserRole extends Model
{
	/**
	 * user_id - 用户ID
	 * @Column(name="user_id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=0, isAutoIncrement=false)
	 * @var int
	 */
	protected $userId;

	/**
	 * 获取 userId - 用户ID
	 *
	 * @return int
	 */ 
	public function getUserId()
	{
		return $this->userId;
	}

	/**
	 * 赋值 userId - 用户ID
	 * @param int $userId user_id
	 * @return static
	 */ 
	public function setUserId($userId)
	{
		$this->userId = $userId;
		return $this;
	}

	/**
	 * role_id - 角色ID
	 * @Column(name="role_id", type="int", length=10, accuracy=0, nullable=false, default="", isPrimaryKey=true, primaryKeyIndex=1, isAutoIncrement=false)
	 * @var int
	 */
	protected $roleId;

	/**
	 * 获取 roleId - 角色ID
	 *
	 * @return int
	 */ 
	public function getRoleId()
	{
		return $this->roleId;
	}

	/**
	 * 赋值 roleId - 角色ID
	 * @param int $roleId role_id
	 * @return static
	 */ 
	public function setRoleId($roleId)
	{
		$this->roleId = $roleId;
		return $this;
	}

}